﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script src="jquery.js" type="text/javascript"></script>
</head>
<body>

<input  value="fi"  name="search" id="search_input" maxlength="50" />  
<input value="button" type="button" id="btnTriggerDemo" />
<script type="text/javascript">
    $(document).ready(function () {

        

        $("#btnTriggerDemo").click(function () {
            // Create a new jQuery.Event object with specified event properties.
            var e = jQuery.Event("keydown", { keyCode: 27 });
            // trigger an artificial keydown event with keyCode 64
            jQuery("document").trigger(e);
        });


        $(document).keydown(function (event) {
            alert(event.keyCode);
        });
    });
</script> 
</body>
</html>
